package com.CST.mapper.cst.zx;

import com.CST.dto.zx.DeptBalanceDetailDTO;
import com.CST.dto.zx.EndingBalanceDTO;
import com.CST.dto.zx.PrimusCashDTO;
import com.CST.entity.zx.ZX_PrimusCash;
import com.CST.entity.zx.ZxDeptDirectorFund;
import com.CST.vo.zx.AllDeptVO;
import com.CST.vo.zx.DeptBalanceDetailVO;
import com.CST.vo.zx.EndingBalanceVO;
import com.CST.vo.zx.PrimusCashVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xnd
 * @since 2023-05-05
 */
@Mapper
public interface ZxDeptDirectorFundMapper extends BaseMapper<ZxDeptDirectorFund> {

    /**
     * 根据period查询基金数据
     * @param period
     * @return
     */
    List<ZxDeptDirectorFund> distinctData(@Param("period") Integer period);

    /**
     * 查询科室汇总数据
     * @param dto
     * @return
     */
    List<EndingBalanceVO> listDeptDirectorFundBalance(@Param("dto") EndingBalanceDTO dto,@Param("userId") String userId);

    /**
     * 科室明细查询
     * @param deptCode,edExtraSecondCode,dateTimeEnd
     * @return
     */
    List<DeptBalanceDetailVO> DeptDirectorFundBalanceByCode(@Param("deptCode") String deptCode,
                                                            @Param("dateTimeStart") String dateTimeStart,
                                                            @Param("dateTimeEnd") String dateTimeEnd);

    /**
     * 科主任基金科室下拉框
     * @return AllDeptVO
     */
    List<AllDeptVO> listDept(String userId);

    /**
     * 科主任基金2019期初设置
     * @return PrimusCashVO
     */
    List<PrimusCashVO> listPrimusCash(PrimusCashDTO entity);

    //修改
    Boolean updatePrimusCash(ZX_PrimusCash entity);

    //新增
    Boolean insertPrimusCash(ZX_PrimusCash entity);

    Boolean deletePrimusCash(Integer id);

    Page<PrimusCashVO> xnsnfas(Page<PrimusCashVO> page,@Param("year") String year);

    void deleteZxDeptDirectorFundByperiod(String period);
}
